//------------------------------------------------------------------------------
// X2D Game Engine
// Copyright (C) 2006-2008 Janusz Kowalski
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------

#ifndef MAIN_LOOP_H
#define MAIN_LOOP_H

typedef Uint32 TimeT;

// Add callback function to the main loop
void mainLoop_addFn(TimeT(*fn)(Uint32, void*), void *data);

// Remove callback function from the main loop
void mainLoop_removeFn(TimeT(*fn)(Uint32, void*), void *data);

// Run the main loop.
// It keeps running until there are no functions to call.
void mainLoop_run();

// Stop running.
void mainLoop_stop();

// Run the loop only once.
TimeT mainLoop_tick();

#endif
